import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store=new Vuex.Store({
    state:{
        cate1id:0,
        cate2id:0,
        cateName:"",
        shortName:"",
        pagecount:0,
        // icon:"",
        // pic:"",
        // smallIcon:"",
        page:0
    },
    getters:{
        getcate1:(state)=>state.cate1id,
        getcate2:(state)=>state.cate2id,
        getcatename:(state)=>state.cateName,
        getshortname:(state)=>state.shortName,
        getpagecount:(state)=>state.pagecount,
        geticon:(state)=>state.icon,
        getpic:(state)=>state.pic,
        getsmallicon:(state)=>state.smallIcon,
        getpage:(state)=>state.page,
    },
    mutations:{
        setcate1:(state,msg)=>{
            state.cate1id=msg
        },
        setcate2:(state,msg)=>{
            state.cate2id=msg
        },
        setcatename:(state,msg)=>{
            state.cateName=msg
        },
        setpagecount:(state,msg)=>{
            state.pagecount=msg
        },
        seticon:(state,msg)=>{
            state.icon=msg
        },
        setpic:(state,msg)=>{
            state.pic=msg
        },
        setsmallicon:(state,msg)=>{
            state.smallIcon=msg
        },
        setshortName:(state,msg)=>{
            state.shortName=msg
        },
        setpage:(state,msg)=>{
            state.page+=msg
        },
        setrefpage:(state,msg)=>{
            state.page=msg
        }
    }
})
export default store